<template>
  <SwiperHome>
    <!-- 默认 -->
    <template #default>
      <div class="swiper-body">
        <div class="swiper-hot">
          <!-- 1 -->
          <div class="hot-top">
            <h2 class="hot-text"></h2>
          </div>
          <!-- 2 -->
          <div class="hot-main">
            <ul class="hot-list">
              <li>为你推荐</li>
              <li>网络歌曲</li>
              <li>经典</li>
              <li>背景音乐</li>
              <li>官方歌单</li>
              <li>情歌</li>
            </ul>
          </div>
        </div>
      </div>
    </template>
    <!-- 具名 -->
    <template #list="item">
      <div class="hot-dvd-list">
        <ul class="dvd-list">
          <li class="dvd-item" v-for="key in item">
            <div class="dvd-box">
              <div class="dvd-box-bottom">
                <a>
                  <img :src="key.img" />123
                  <i class="dvd-player"></i>
                  <i class="dvd-background"></i>
                </a>
              </div>
              <h4>
                <span>{{ key.title }}</span>
              </h4>
              <div class="dvd-author">
                <a>{{ key.playCount }}</a>
              </div>
            </div>
          </li>
        </ul>
      </div>
    </template>
  </SwiperHome>
</template>

<script>
export default {
  name: 'Home',
}
</script>

<script setup>
import SwiperHome from './components/swiper'
</script>

<style scoped lang="less">
/* 1-start */

.swiper-hot {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .hot-top {
    margin-top: 50px;
    width: 100%;

    .hot-text {
      background-image: url('./img/index_tit5.png');
      background-size: 100%;
      display: block;
      margin: 0 auto;
      width: 196px;
      height: 40px;
      background-position: 0 0;
    }
  }
  .hot-main {
    margin-top: 24px;
    width: 100%;

    .hot-list {
      width: 100%;
      text-align: center;
      li {
        display: inline-block;
        font-size: 15px;
        margin: 0 24px;
        color: #333;
      }
    }
  }
}

.hot-dvd-list {
  overflow: hidden;
  margin: 0 auto;
  width: 1200px;
  box-sizing: border-box;
  .dvd-list {
    overflow: hidden;
    margin-top: 50px;
    margin-bottom: 35px;
  }
  .dvd-item {
    list-style: none;
    float: left;
    white-space: nowrap;
    margin-right: 10px;
  }
  .dvd-box {
    width: 228px;
    height: 309px;
    padding-right: 20px;
    box-sizing: border-box;
  }
  .dvd-box-bottom {
    width: 210px;
    height: 230px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
  }
  .dvd-box-bottom img {
    width: 210px;
    height: 230px;
    /* box-sizing: border-box; */
  }
  .dvd-author a {
    color: #999;
    display: inline-block;
    height: 22px;
    font-size: 14px;
  }

  .dvd-box h4 {
    font-weight: normal;
    font-size: 14px;
    height: 22px;
  }
  .dvd-box h4:hover {
    color: #31c27c;
  }
  .dvd-player {
    position: absolute;
    width: 40px;
    height: 40px;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    /* transform: translate(-50%,-50%); */
    background-image: url(./img/player.png);
    background-size: cover;
    background-position: center;
    /* border: none; */
    opacity: 0;
    margin-left: -30px;
    margin-top: -30px;
  }
  .dvd-box:hover .dvd-player {
    position: absolute;
    width: 60px;
    height: 60px;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    /* margin-left: -30px;
  margin-top: -30px; */
    transform: translate(-50%, -50%);
    background-size: cover;
    background-position: center;
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.7s;
  }
  .dvd-background {
    position: absolute;
    width: 210px;
    height: 230px;
    top: 0;
    left: 0;
    background-color: #000;
    z-index: -1;
  }
  .dvd-box:hover .dvd-box-bottom a img {
    transform: scale(1.1);
    transition: all 0.7s;
  }
  .dvd-box:hover .dvd-background {
    transition: all 0.7;
    opacity: 0.2;
    z-index: 1;
  }
}
/* 1-end */
</style>
